﻿
/*========================================================================================
// -- 
//创建者: goodasong
//创建时间：2011年9月23日 星期五
//类描述：实体类 TRole (属性说明自动提取数据库字段的描述信息)
//最后修改者:goodasong
//最后修改时间:2011年9月23日 星期五	
=========================================================================================*/
using System;
using System.Web;
using System.Runtime.Serialization;

namespace COM.Rights.Model
{
    /// <summary>
    /// 实体类 TRole (属性说明自动提取数据库字段的描述信息)
    /// </summary>
    [Serializable]	  
    [Model(Name = "TRole", PrimaryKey = "GID", ModelType = ModelType.Table, Condition = "1=1", IsNeedRecordModify = true)]
    public partial class TRoleInfo : BaseModel
    {
        public TRoleInfo()
        {            
            PrimaryKey = "GID"; 
			Fields.Add("ID");//标识
			Fields.Add("GID");//主键
			Fields.Add("Name");//名称
			Fields.Add("CreatTime");//创建时间
			Fields.Add("Creator");//创建者
			
			
			
			CanNotNullFields.Add("GID");//主键不能为空!				
			this.OnCreated();			
			this.OnModelCreated();
        }
		public TRoleInfo(bool isNewInfo)
        {
			IsNew = isNewInfo;
		}
		#region 方法

        public void OnCreated() { this.SetPrimaryKeyValue(); }		

		public override void SetPrimaryKeyValue()
        {
            GID = Guid.NewGuid().ToString();
        }
        #endregion 
		
		#region 成员变量
				
		private int? _ID;//标识
		private string _GID;//主键
		private string _Name;//名称
		private DateTime? _CreatTime;//创建时间
		private string _Creator;//创建者
		
		#endregion
		
		#region 属性 
		
		/// <summary>
        /// 标识
        /// </summary>       
		[ModelField(Description = "标识", Type = typeof(int?), ErrorMessage = "标识信息错误!", FieldType = FieldType.Normal, IsKeyField = false,IsUnique = false, IsForeignKey = false, IsAllowNull = false, IsDbGenerated = false, Size = 4,  DbType = "int", IsNeedRecordModify = true)]
        public virtual int? ID
        {
            get
            {
                return this._ID;
            }
            set
            {
				_ID = value;
            }
        }
		
		/// <summary>
        /// 主键
        /// </summary>       
		[ModelField(Description = "主键", Type = typeof(string), ErrorMessage = "主键信息错误!", FieldType = FieldType.Normal, IsKeyField = true,IsUnique = true, IsForeignKey = false, IsAllowNull = false, IsDbGenerated = false, Size = 36,  DbType = "char", IsNeedRecordModify = true)]
        public virtual string GID
        {
            get
            {
                return this._GID;
            }
            set
            {
                if (_GID != value)
                {
                    if (!IsGetDataFromDB)
                    {
                        ModifyInfo modifyInfo = new ModifyInfo("TRole", "GID", _GID, value, "char", "主键");   
                        this.OnPropertyChanging(modifyInfo);
                        this.OnGIDChanging(modifyInfo);
                        this.SendPropertyChanging(modifyInfo);

                        this._GID = value;

                        this.OnPropertyChanged(modifyInfo);
                        this.OnGIDChanged(modifyInfo);
                        this.SendPropertyChanged(modifyInfo);      
                    }
                    else
                    {
                        _GID = value;
                    }
                }
            }
        }
		
		/// <summary>
        /// 名称
        /// </summary>       
		[ModelField(Description = "名称", Type = typeof(string), ErrorMessage = "名称信息错误!", FieldType = FieldType.Normal, IsKeyField = false,IsUnique = false, IsForeignKey = false, IsAllowNull = true, IsDbGenerated = false, Size = 50,  DbType = "nvarchar", IsNeedRecordModify = true)]
        public virtual string Name
        {
            get
            {
                return this._Name;
            }
            set
            {
                if (_Name != value)
                {
                    if (!IsGetDataFromDB)
                    {
                        ModifyInfo modifyInfo = new ModifyInfo("TRole", "Name", _Name, value, "nvarchar", "名称");   
                        this.OnPropertyChanging(modifyInfo);
                        this.OnNameChanging(modifyInfo);
                        this.SendPropertyChanging(modifyInfo);

                        this._Name = value;

                        this.OnPropertyChanged(modifyInfo);
                        this.OnNameChanged(modifyInfo);
                        this.SendPropertyChanged(modifyInfo);      
                    }
                    else
                    {
                        _Name = value;
                    }
                }
            }
        }
		
		/// <summary>
        /// 创建时间
        /// </summary>       
		[ModelField(Description = "创建时间", Type = typeof(DateTime?), ErrorMessage = "创建时间信息错误!", FieldType = FieldType.Normal, IsKeyField = false,IsUnique = false, IsForeignKey = false, IsAllowNull = true, IsDbGenerated = false, Size = 8,  DbType = "datetime", IsNeedRecordModify = true)]
        public virtual DateTime? CreatTime
        {
            get
            {
                return this._CreatTime;
            }
            set
            {
                if (_CreatTime != value)
                {
                    if (!IsGetDataFromDB)
                    {
                        ModifyInfo modifyInfo = new ModifyInfo("TRole", "CreatTime", _CreatTime, value, "datetime", "创建时间");   
                        this.OnPropertyChanging(modifyInfo);
                        this.OnCreatTimeChanging(modifyInfo);
                        this.SendPropertyChanging(modifyInfo);

                        this._CreatTime = value;

                        this.OnPropertyChanged(modifyInfo);
                        this.OnCreatTimeChanged(modifyInfo);
                        this.SendPropertyChanged(modifyInfo);      
                    }
                    else
                    {
                        _CreatTime = value;
                    }
                }
            }
        }
		
		/// <summary>
        /// 创建者
        /// </summary>       
		[ModelField(Description = "创建者", Type = typeof(string), ErrorMessage = "创建者信息错误!", FieldType = FieldType.Normal, IsKeyField = false,IsUnique = false, IsForeignKey = false, IsAllowNull = true, IsDbGenerated = false, Size = 50,  DbType = "varchar", IsNeedRecordModify = true)]
        public virtual string Creator
        {
            get
            {
                return this._Creator;
            }
            set
            {
                if (_Creator != value)
                {
                    if (!IsGetDataFromDB)
                    {
                        ModifyInfo modifyInfo = new ModifyInfo("TRole", "Creator", _Creator, value, "varchar", "创建者");   
                        this.OnPropertyChanging(modifyInfo);
                        this.OnCreatorChanging(modifyInfo);
                        this.SendPropertyChanging(modifyInfo);

                        this._Creator = value;

                        this.OnPropertyChanged(modifyInfo);
                        this.OnCreatorChanged(modifyInfo);
                        this.SendPropertyChanged(modifyInfo);      
                    }
                    else
                    {
                        _Creator = value;
                    }
                }
            }
        }
		#endregion 属性
				  
		#region 属性更改事件
		
		partial void OnIDChanging(ModifyInfo modifyInfo);//标识ID改变之前发生
        partial void OnIDChanged(ModifyInfo modifyInfo);//标识ID改变之后发生
		partial void OnGIDChanging(ModifyInfo modifyInfo);//主键GID改变之前发生
        partial void OnGIDChanged(ModifyInfo modifyInfo);//主键GID改变之后发生
		partial void OnNameChanging(ModifyInfo modifyInfo);//名称Name改变之前发生
        partial void OnNameChanged(ModifyInfo modifyInfo);//名称Name改变之后发生
		partial void OnCreatTimeChanging(ModifyInfo modifyInfo);//创建时间CreatTime改变之前发生
        partial void OnCreatTimeChanged(ModifyInfo modifyInfo);//创建时间CreatTime改变之后发生
		partial void OnCreatorChanging(ModifyInfo modifyInfo);//创建者Creator改变之前发生
        partial void OnCreatorChanged(ModifyInfo modifyInfo);//创建者Creator改变之后发生
		
		#endregion		
		
		public virtual string DetailURI { get; set; }
        public virtual string DetailHTMLURI { get; set; }
		public virtual string ManageEditURI {get; set;}
		public virtual string ManageDetailURI {get; set;}
		
		public override void OnLoaded()
        {
            base.OnLoaded();	
			DetailURI = ZModel.InitDetailURI("TRole", "GID", GID);
            DetailHTMLURI = ZModel.InitDetailHTMLURI("TRole", "GID", GID);		
			ManageEditURI = ZModel.InitMEditURI("TRole", "GID", GID);	
		 	ManageDetailURI = ZModel.InitMDetailURI("TRole", "GID", GID);	
			OnModelLoaded();
        }
		
		partial void OnModelCreated();
        partial void OnModelLoaded();
	}	
}